import { createRouter, createWebHashHistory } from 'vue-router'

import Home from '../views/Home.vue'
import Mysef from '../views/myself.vue'
import Homepage from '../views/homepage.vue'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
    },
    {
      path: '/mycenter',
      name: 'mycenter',
      component:Mysef,
      redirect: '/myself',
      children: [
        {
          path: '/myself',
          name: 'myself',
          component: () => import('../views/mycenter/index.vue'),
        },
        {
          path: '/zuoping',
          name: 'zuoping',
          component: () => import('../views/mycenter/zuoping.vue'),
        },
        {
          path: '/xiaoxi',
          name: 'xiaoxi',
          component: () => import('../views/mycenter/xiaoxi.vue'),
        },
        {
          path: '/rijisuibi',
          name: 'rijisuibi',
          component: () => import('../views/mycenter/rijisuibi.vue'),
        }
      ]
    },
    // 论坛
    {
      path: '/homepage',
      name: 'homepage',
      component:Homepage,
      redirect: '/square',
      children: [
        {
          path: '/square',
          name: 'square',
          component: () => import('../views/forum/square.vue'),
        },
      ]
    },
    {
      path: '/widget',
      name: 'widget',
      component: () => import('../components/Widget.vue'),
    },
    {
      path: '/author',
      name: 'author',
      component: () => import('../views/author.vue'),
    },
    {
      path: '/portfolios',
      name: 'portfolios',
      component: () => import('../views/Portfolios.vue'),
    },
    {
      path: '/upload',
      name: 'upload',
      component: () => import('../views/upload.vue'),
    },
    // 作品详情
    {
      path: '/workdetails',
      name: 'workdetails',
      component: () => import('../views/Workdetails.vue'),
    },
    
    {
      path: '/shiyan',
      name: 'shiyan',
      component: () => import('../views/Waterfall.vue'),
    },
  ],
})

export default router
